
int main(){
    FILE* dataFile=NULL;
    int i =0;
    int val = 0;



    if((dataFile=fopen("in.c","r"))==NULL){
        printf("in.c does not exist or could not be opened");
        return EXIT_FAILURE;
    }
    if((writeFile=fopen("out.c","w"))==NULL){
        printf("out.c coud not be opened or written");
        return EXIT_FAILURE;
    }

    while ((val=fgetc(dataFile)) != EOF) {
        if(i == 0){ 
            if(val == '/'){
                
                if((val=fgetc(dataFile)) == '*'){
                    i = 1;
                }
                else{
                    ungetc(val,dataFile);
                    val = '/';
                    fputc(val, writeFile);
                }
            
            }
            else{
                fputc(val, writeFile);
            }
       }         
       
        
       else{
           if(val == '*'){

               if((val=fgetc(dataFile)) == '/'){
                   i=0;
               }
           }
       }
    
    
    }  //end of while

